home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / magazine / pd_utils / agassm / rexx / octamedplayer.agassm < prev    next >
Text File  |  1996-03-30  |  2KB  |  100 lines

  1. /* AGASSM - OctaMED Player control script */
  2. /* © 1995 Paul Vernon */
  3.  
  4. /* This ARexx program uses a couple of commands from the C: directory
  5. to interact with the user using the asl.library file requester.
  6. The asl requester returns a string surrounded in "" so these have
  7. to be stripped for the program to work correctly! */
  8.  
  9. Port = Show('P','AGASSM')
  10. If Port = 0 then do
  11.   Exit
  12.   End            
  13.  
  14. /* Look for OctaMEDPlayers ARexx port.
  15. If it's not there ask where OctaMEDPlayer is */
  16.  
  17. OPTIONS RESULTS
  18.  
  19. exists = Show('P','OCTAMEDPLAYER')
  20. If exists = 0 then do
  21.   ADDRESS COMMAND 'C:RequestFile > T:AGASSM-Temp TITLE "Where is OctaMEDPlayer?" NOICONS'
  22.   succ = Open(file,'T:AGASSM-Temp','r')
  23.   If succ = 0 then do
  24.     Exit
  25.     End
  26.   String = ReadLn(file)
  27.   succ = Close(file)
  28.   ADDRESS COMMAND 'C:Delete T:AGASSM-Temp QUIET'
  29.   If String = '' then do
  30.     Exit
  31.     End
  32.   String = Left(String,Length(String)-1)
  33.   String = Right(String,Length(String)-1)
  34.   ADDRESS COMMAND 'C:Run' String
  35.   End
  36.  
  37. /* Once OctaMEDPlayer is running, ask for a module to load */
  38. /* Load the module into OctaMEDPlayer and Play it */
  39.  
  40. ADDRESS COMMAND 'C:RequestChoice >T:AGASSM-Temp "AGASSM - OctaMED Player" "Do you want to play the current module?" "Yes|Load another|No"'
  41. succ = Open(file,'T:AGASSM-Temp','r')
  42. If succ = 0 then do
  43.   Exit
  44.   End
  45. String = ReadLn(file)
  46. succ = Close(file)
  47.  
  48. ADDRESS COMMAND 'C:Delete T:AGASSM-Temp QUIET'
  49.  
  50. If String = '1' then do
  51.   ADDRESS 'OCTAMEDPLAYER'
  52.   Play
  53.   Exit
  54.   End
  55. If String = '0' then do
  56.   ADDRESS 'OCTAMEDPLAYER'
  57.   Stop
  58.   Exit
  59.   End
  60.  
  61. ADDRESS COMMAND 'C:RequestFile > T:AGASSM-Temp TITLE "AGASSM - Select a module" POSITIVE "Load" NEGATIVE "Quit" NOICONS'
  62.  
  63. succ = Open(file,'T:AGASSM-Temp','r')
  64. If succ = 0 then do
  65.   Exit
  66.   End
  67. String = ReadLn(file)
  68. succ = Close(file)
  69.  
  70. ADDRESS COMMAND 'C:Delete T:AGASSM-Temp QUIET'
  71.  
  72. If String = '' then do
  73.   ADDRESS 'OCTAMEDPLAYER'
  74.   Stop
  75.   ADDRESS COMMAND 'C:RequestChoice > T:AGASSM-Temp "AGASSM - Quit OctaMEDPlayer" "Do you want to quit?" "OK|CANCEL"'
  76.   succ = Open(file,'T:AGASSM-Temp','r')
  77.     If succ= 0 then do
  78.       Exit
  79.       End
  80.     String = ReadLn(file)
  81.     succ = Close(file)
  82.     ADDRESS COMMAND 'C:Delete T:AGASSM-Temp QUIET'
  83.     If String = '0' then do
  84.       Exit
  85.       End
  86.   ADDRESS 'OCTAMEDPLAYER'
  87.   Quit
  88.   Exit
  89.   End
  90.  
  91. ADDRESS 'OCTAMEDPLAYER'
  92.  
  93. String=Left(String,Length(String)-1)
  94. String=Right(String,Length(String)-1)
  95.  
  96. LoadMod String
  97. Play
  98.  
  99. Exit
  100.